05. Flight Computer Programming

04 V3

Connection to Code

When writing your solution to this project, you will write flight computer code by filling out methods in a class called BackyardFlyer (which inherits from a Udacity-provided Drone class). The code you write will have several responsibilities, but two of the most important will involve:

  1. Setting the drone's target position (for the autopilot to follow) - You'll do this by using the cmd_position method from the Udacity-provided Drone class.
  2. Responding to messages from the autopilot - Your BackyardFlyer class will be sent messages from the autopilot to let it know when something about the drone has changed. For example, the autopilot will send a LOCAL_POSITION message whenever the drone's local position changes. You'll be responsible for registering certain functions (called "callback functions") to respond to these messages. For example, if you want to call some function named local_position_callback whenever you receive a LOCAL_POSITION update, you would write code that says
self.register_callback(MsgID.LOCAL_POSITION, self.local_position_callback)

This code will make more sense by the end of this lesson.

A Note on Prerequisites

Python and Object Oriented Programming

In this Nanodegree, we assume that you know Python. In particular, we assume you are comfortable with object oriented programming (OOP) in Python.

If you need a refresher on Python or OOP, consider reviewing Udacity's Programming Foundations with Python

Git and Github

We will be using git and Github throughout this Nanodegree and we assume you are familiar with the basics of of these technologies. If you find yourself confused by git or Github, take a look at Udacity's Version Control with Git.